import {Column, Entity, PrimaryGeneratedColumn} from "typeorm";
import {BaseEntity} from "../../../../common/entities/base";

@Entity('fd_issue',{
    comment: '问卷题目表',
})
export class IssueEntity extends BaseEntity{
    @PrimaryGeneratedColumn({ type: 'int', name: 'issue_id', comment: '问题ID' })
    public issueId: number;

    @Column({ type: 'varchar', name: 'title', default:null, comment: '标题' })
    public title: string;


    @Column({ type: 'varchar', name: 'sub_title', default:null, comment: '副标题' })
    public subTitle: string;

    @Column({ type: 'varchar', name: 'keyword', default:null, comment: '关键字' })
    public keyword: string;

    @Column({ type: 'varchar', name: 'in_store', default:'N', comment: '是否加入题库' })
    public inStore: string;

    @Column({ type: 'varchar', name: 'field', default:null, comment: '字段键名' })
    public field: string;

    @Column({ type: 'varchar', name: 'type', default:null, comment: '题目类型' })
    public type: string;

    @Column({ type: 'varchar', name: 'type_name', default:null, comment: '题目类型名称' })
    public typeName: string;

    @Column({ type: 'json', name: 'options', default:null, comment: '选项信息' })
    public options: Record<string, any>[];

    @Column({ type: 'varchar', name: 'tag', default:null, comment: '题目标签' })
    public tag: string;

    @Column({ type: 'varchar', name: 'is_required', default:'Y', comment: '是否必答' })
    public isRequired: string;

    @Column({ type: 'varchar', name: 'is_subjective', default:'Y', comment: '是否主观题' })
    public isSubjective: string;

    @Column({ type: 'text', name: 'answer', default:null, comment: '正确答案' })
    public answer: string;

    @Column({ type: 'varchar', name: 'need_valid', default:'N', comment: '是否校验' })
    public needValid: string;

    @Column({ type: 'simple-array', name: 'validate_arr', default:null, comment: '校验规则' })
    public validateArr: string [];

    @Column({ type: "simple-json", name: 'attribute',  default:null, comment: '组件属性配置' })
    public attribute: Record<string, any>

}











